<?php

use App\User;

use Illuminate\Database\Seeder;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = Faker\Factory::create('en_US');

        User::truncate();

        foreach(range(1,9) as $index) {
            User::create([
                'name' => $faker->firstName(),
                'email' => $faker->email,
                'password' => bcrypt($faker->numberBetween(100000, 999999))
            ]);
        }
        User::create([
            'name' => 'demo',
            'email' => 'demo.knyang@gmail.com',
            'password' => Hash::make('demoyang')
        ]);
    }
}
